import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/hello")
public class HelloServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //注意，自动生成的这个调用父类方法的代码一定要注释掉
        //super.doGet(req, resp);
        //是 Tomcat这边打印个日志
        System.out.println("hello");
        //给客户端返回一个hello
        resp.getWriter().write("hello");
    }
}
